package com.telecom.cms.service;

import java.util.List;
import com.telecom.cms.dao.CampCustAppdRsltTempDAO;
import com.telecom.cms.dao.DaoImp;
import com.telecom.cms.dto.CampCustAppdRsltTemp;

public class CampCustAppdRsltTempMgr {
   
	public void save(CampCustAppdRsltTemp campcamp){
		(new CampCustAppdRsltTempDAO()).insert(campcamp);
	}
	
	public void  delete(CampCustAppdRsltTemp campcamp){
		(new CampCustAppdRsltTempDAO()).delete(campcamp);
	}
	
	public List findall(){
		List result=(new CampCustAppdRsltTempDAO()).findAll();
		return result;
	}
	
	public CampCustAppdRsltTemp findbyid(String campid){
		CampCustAppdRsltTemp result=(new CampCustAppdRsltTempDAO()).findById(campid);
		return result;
	}
	
	public int insertfromsql(String mysql,int campid,String clu_type,String latnid) 
	{
		return (new CampCustAppdRsltTempDAO()).insertfromsql(mysql,campid,clu_type,latnid) ;
	}
	
	public int insertfromclu(int custcluid,int campid,String clu_type,String latnid) {
		return (new CampCustAppdRsltTempDAO()).insertfromclu(custcluid,campid,clu_type,latnid) ;
	}
	
	public boolean checksql(String sql) {
		return (new DaoImp()).checksql(sql);
	}
	
	public int insertonerow(String campId,String nbrType,String accsNbr,String latncd,String latnid) {
		//nbrType:1-phone nbr 2-Prd_inst_id
		if(nbrType.equals("1"))
			nbrType="accs_nbr";
		else if(nbrType.equals("2"))
		    nbrType="Prd_inst_id";
		else if(nbrType.equals("3"))
			nbrType="cust_id";
			
		return (new CampCustAppdRsltTempDAO()).insertonerow(campId,nbrType,accsNbr,latncd,latnid);
	}
	
	public int count(String campid) 
	{
		return (new CampCustAppdRsltTempDAO()).count(campid);
	}
	
	public int count(String campid,String campseqid) 
	{
		return (new CampCustAppdRsltTempDAO()).count(campid,campseqid);
	}
	
	public int countuse(String campid) 
	{
		return (new CampCustAppdRsltTempDAO()).countuse(campid);
	}
}
